package com.fowo.api.service.handleWork;

import com.fowo.api.entity.ProcessProduct;
import com.fowo.api.model.process.product.ProcessProductSubAction;
import com.fowo.api.model.process.product.ProcessProductVo;
import com.fowo.api.service.ProcessProductService;
import com.fowo.api.service.impl.ProcessProductServiceImpl;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import javax.annotation.Resource;
import java.util.List;

@Component
public class ProcessProductSubActionImpl implements ProcessProductSubAction {

    @Resource
    private ProcessProductServiceImpl processProductService;

    @Override
    public void run(List<Long> idList) throws Exception {
        for(int i=0;i<idList.size();i++){
            ProcessProduct byId = processProductService.getById(idList.get(i));
            byId.setStatus("1");
            processProductService.updateById(byId);
        }
    }
}
